//
//  ViewShowAnimation.m
//  DecentProject
//
//  Created by shaowei on 13-4-8.
//  Copyright (c) 2013年 vin. All rights reserved.
//

#import "ViewShowAnimation.h"

@implementation ViewShowAnimation

+ (void)showView:(UIView *)showView fromView:(UIView *)fromView{
    showView.alpha = 0.0f;
    [fromView addSubview:showView];
    [UIView animateWithDuration:VIEW_ANIMATION_DURATION*0.5f
                          delay:0
                        options:0
                     animations:^{
                         showView.alpha = 1.0f;
                     } completion:^(BOOL finished) {
                         
                     }];
}

+ (void)hideView:(UIView *)showView andIsRemoved:(BOOL)isRemoved{
    [UIView animateWithDuration:VIEW_ANIMATION_DURATION*0.5f
                          delay:0
                        options:0
                     animations:^{
                         showView.alpha = 0.0f;
                     } completion:^(BOOL finished) {
                         if (isRemoved) {
                             [showView removeFromSuperview];
                         }
     
                     }];
}

@end
